package leaveSystem.model;

import java.io.Serializable;
import java.util.Date;

public class PublicHolidays implements Cloneable, Serializable {

    private int publicHolidaysId;
    private String name;
    private String description;
    private Date dateFrom;
    public Date getDateFrom() {
		return dateFrom;
	}

	public void setDateFrom(Date dateFrom) {
		this.dateFrom = dateFrom;
	}

	public Date getDateTo() {
		return dateTo;
	}

	public void setDateTo(Date dateTo) {
		this.dateTo = dateTo;
	}

	private Date dateTo;


    public PublicHolidays () {

    }

    public PublicHolidays (int publicHolidaysIdIn) {

          this.publicHolidaysId = publicHolidaysIdIn;

    }


    public int getPublicHolidaysId() {
          return this.publicHolidaysId;
    }
    public void setPublicHolidaysId(int publicHolidaysIdIn) {
          this.publicHolidaysId = publicHolidaysIdIn;
    }

    public String getName() {
          return this.name;
    }
    public void setName(String nameIn) {
          this.name = nameIn;
    }

    public String getDescription() {
          return this.description;
    }
    public void setDescription(String descriptionIn) {
          this.description = descriptionIn;
    }

    
    public void setAll(int publicHolidaysIdIn,
          String nameIn,
          String descriptionIn,
          java.sql.Date dateFromIn,
          java.sql.Date dateToIn) {
          this.publicHolidaysId = publicHolidaysIdIn;
          this.name = nameIn;
          this.description = descriptionIn;
          this.dateFrom = dateFromIn;
          this.dateTo = dateToIn;
    }

    public boolean hasEqualMapping(PublicHolidays valueObject) {

          if (valueObject.getPublicHolidaysId() != this.publicHolidaysId) {
                    return(false);
          }
          if (this.name == null) {
                    if (valueObject.getName() != null)
                           return(false);
          } else if (!this.name.equals(valueObject.getName())) {
                    return(false);
          }
          if (this.description == null) {
                    if (valueObject.getDescription() != null)
                           return(false);
          } else if (!this.description.equals(valueObject.getDescription())) {
                    return(false);
          }
          if (this.dateFrom == null) {
                    if (valueObject.getDateFrom() != null)
                           return(false);
          } else if (!this.dateFrom.equals(valueObject.getDateFrom())) {
                    return(false);
          }
          if (this.dateTo == null) {
                    if (valueObject.getDateTo() != null)
                           return(false);
          } else if (!this.dateTo.equals(valueObject.getDateTo())) {
                    return(false);
          }

          return true;
    }


    public String toString() {
        StringBuffer out = new StringBuffer("");
        out.append("\nclass PublicHolidays, mapping to table public_holidays\n");
        out.append("Persistent attributes: \n"); 
        out.append("publicHolidaysId = " + this.publicHolidaysId + "\n"); 
        out.append("name = " + this.name + "\n"); 
        out.append("description = " + this.description + "\n"); 
        out.append("dateFrom = " + this.dateFrom + "\n"); 
        out.append("dateTo = " + this.dateTo + "\n"); 
        return out.toString();
    }

    public Object clone() {
        PublicHolidays cloned = new PublicHolidays();

        cloned.setPublicHolidaysId(this.publicHolidaysId); 
        if (this.name != null)
             cloned.setName(new String(this.name)); 
        if (this.description != null)
             cloned.setDescription(new String(this.description)); 
        if (this.dateFrom != null)
             cloned.setDateFrom((java.sql.Date)this.dateFrom.clone()); 
        if (this.dateTo != null)
             cloned.setDateTo((java.sql.Date)this.dateTo.clone()); 
        return cloned;
    }

}


